This invention relates to a method of preparing substrates for optical sensors used for measuring the concentrations, activities and partial pressures of samples.